package com.headStorm.concurrent.manyThread;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author zhangqq
 * @create 2021-07-21 11:53
 **/
public class CallableTest implements Callable {

    @Override
    public Object call() throws Exception {
        System.out.println("--------------hahahaha---------");
        return "success";
    }

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CallableTest callableTest = new CallableTest();
        FutureTask<Integer> futureTask = new FutureTask<Integer>(callableTest);
//        Thread thread = new Thread(futureTask);
//        thread.start();
        futureTask.run();
        futureTask.get();
        System.out.println("aa");

    }
}
